﻿using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;
using System.Collections.ObjectModel;
using System.Linq;
using System;
using ASPItalia.ModelVirtualCasting.Silverlight.BackOffice.Manager;

namespace ASPItalia.ModelVirtualCasting.Silverlight.BackOffice.Converters
{
  public class MultimediaPathConverter : IValueConverter
  {
    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
      string fileName = value as string;
      if (fileName != null && !String.IsNullOrEmpty(fileName))
      {
        fileName =  String.Format("{0}Images/{1}", Helper.GetBaseUri(), fileName);
      }

      return fileName;
    }

    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
      throw new NotImplementedException();
    }
  }
}
